// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/parking/api/ParkEntranceApi'

import OneClass from '@api/parking/model/EntranceReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 单项 —————————————————————————————— //

  async getOne({ id }, TIP = '查询出入口详情') {
    const DTO = CORE.grpcDTO(OneClass, { ids: [id] })
    const { entrance, content = [] } = await CORE.grpc(TIP, CLIENT, 'queryEntranceDetail', DTO)
    return { ...entrance, roadway: content }
  },
}
